package models_main

import (
	"fmt"
	"longmen/server/pkg/db/mysql/models"
	"time"
)

/*
  `uid` int(11) NOT NULL,
  `count` INT(10) NOT NULL DEFAULT '0' COMMENT '总签到数' AFTER `uid`;
  `continuous` int(10) DEFAULT '0' COMMENT '连续签到天数',
  `count` INT(10) NOT NULL DEFAULT '0' COMMENT '总签到数' AFTER `uid`;
  `last_check_time` datetime DEFAULT NULL COMMENT '上次签到时间',
*/
type UserCheckin struct {
	Uid                int       `json:"uid" gorm:"primaryKey"`
	Continuous         int       `json:"continuous"`
	Count              int       `json:"count"`                 //INT(10) NOT NULL DEFAULT '0' COMMENT '总签到数',
	OrdNum             int       `json:"ord_num"`               //INT(10) NOT NULL DEFAULT '0' COMMENT '周期序数',
	DrawNum            int       `json:"draw_num"`              //INT(10) NOT NULL DEFAULT '0' COMMENT '免费抽奖次数',
	LastCheckStartTime time.Time `json:"last_check_start_time"` // datetime DEFAULT NULL COMMENT '上次连续签到开始时间'
	LastCheckTime      time.Time `json:"last_check_time"`       //`last_check_time` datetime DEFAULT NULL COMMENT '上次签到时间',
}

func (UserCheckin) TableName() string {
	return fmt.Sprintf("%suser_checkin", models.Prefix)
}
